package org.sky.model;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 12-11-7
 * Time: 下午6:01
 * To change this template use FileUtil | Settings | FileUtil Templates.
 */

@Entity
public class Evaluate {

    /**
     * 系统编号
     */
    private int id;

    /**
     * 评论用户
     */
    private Person user;

    /**
     * 评价等级
     */
    private int star;

    /**
     * 评论内容
     */
    private String evaluate;

    /**
     * 评论文件
     */
    private FileUtil file;


    @Id
    @GeneratedValue
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @ManyToOne
    @JoinColumn(name = "userId", nullable = false)
    public Person getUser() {
        return user;
    }

    public void setUser(Person user) {
        this.user = user;
    }

    @Enumerated(EnumType.ORDINAL)
    public int getStar() {
        return star;
    }

    public void setStar(int star) {
        this.star = star;
    }

    public String getEvaluate() {
        return evaluate;
    }

    public void setEvaluate(String evaluate) {
        this.evaluate = evaluate;
    }

    @ManyToOne
    @JoinColumn(name = "fileId", nullable = false)
    public FileUtil getFile() {
        return file;
    }

    public void setFile(FileUtil file) {
        this.file = file;
    }
}
